#! /usr/bin/php5
<?

$sRootPath = '/home/alee/Project/JeCat/W3B/trunk/' ;
FindDir($sRootPath) ;


function FindDir($sDirPath)
{
	$h = opendir($sDirPath) ;
	while( $sFilename=readdir($h) )
	{
		if( in_array( $sFilename,array('.','..') ) )
		{
			continue ;
		}
		
		$sFilePath = $sDirPath.$sFilename ;
		if( is_dir($sFilePath) )
		{
			FindDir($sFilePath.'/');
		}
		
		else 
		{
			ProcFile($sFilePath) ;
		}
	}

}


function ProcFile($sFilePath)
{
	$sFilename = basename($sFilePath) ;
	if( !preg_match('/^template\..+\.html\.compiled\.php$/i',$sFilename) )
	{
		return ;
	}
	
	unlink($sFilePath) ;
	echo $sFilePath,"\r\n" ;
}
?>